package com.acme.homemonitoring;

public class TestSensor implements Sensor
{
	private Room room;
	private Light light;
	
	public TestSensor( Light light)
	{
		this.light = light;
	}
	
	
	
	public void setRoom(Room room) {
		this.room = room;
	}



	/* (non-Javadoc)
	 * @see com.acme.homemonitoring.Sensor#sensorTripped()
	 */
	@Override
	public void sensorTripped()
	{
		// notify the room and turn on the light		
		light.turnOn();
		room.sensorTripped();
	}

	/* (non-Javadoc)
	 * @see com.acme.homemonitoring.Sensor#reset()
	 */
	@Override
	public void reset()
	{
		System.out.println("!! sensor reset");
	}

	/* (non-Javadoc)
	 * @see com.acme.homemonitoring.Sensor#report()
	 */
	@Override
	public void report()
	{
		System.out.println("Test Sensor");
	}
}
